﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
namespace SQT.tracnghiem.Ajax.ASP.Class
{
    public partial class add_student : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string check = Request.QueryString["check"];
            int cls = int.Parse(Request.QueryString["cls"]);
            string[] split = new string[check.Split(',').Length];
            split = check.Split(',');

            string[] split2 = new string[2];

            for (int i = 0; i < check.Split(',').Length - 1; i++)
            {
                split2 = split[i].Split('_');
                if (int.Parse(split2[1]) == 0)
                    continue;
                else
                {
                    var get_user = new TblUserController().FetchAll().Where(x=>x.UserId==int.Parse(split2[0])).Single();
                    new TblUserController().Update(get_user.UserId, get_user.NumberStudy, get_user.UserName, get_user.UserPass, get_user.FullName, get_user.BirthDay, get_user.Phone, get_user.Avatar, get_user.Email, get_user.AddressMail, get_user.Address, get_user.Facebook, get_user.Sex, get_user.UserLevel, cls, get_user.Active, get_user.SignInDate,get_user.Wallpaper, get_user.Note);
                }
            }
        }
    }
}